<template>
  <div id="app">
    <el-form :model="Laboratory" label-width="100px" title="实验室添加">

      <el-form-item label="实验室姓名" prop="name">
        <el-input v-model="Laboratory.name"></el-input>
      </el-form-item>

      <el-form-item label="实验室描述">
        <el-input v-model="Laboratory.description"></el-input>
      </el-form-item>

      <el-form-item label="实验室容量">
        <el-input v-model="Laboratory.capacity"></el-input>
      </el-form-item>

      <el-form-item>
        <el-button type="primary" @click.prevent="add">保存</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: "AddLaboratory",
  data(){
    return{
      Laboratory:{}
    }
  },
  methods:{
    add(){
      this.$confirm("是否确认提交","保存提示").then(()=> {
        this.axios.post("/laboratory/addLab", this.Laboratory).then((resp) => {
          if (resp.data.status == "success") {
            this.$message.success("添加成功！");
            this.$router.push("/laboratory/LaboratoryList")
          }
        })
      })
    }
  }
}
</script>

<style scoped>

</style>
